#ifndef LOGINWIDGET_H
#define LOGINWIDGET_H

#include "customevent.h"
#include <QWidget>
class QLineEdit;
class QCheckBox;
class QPushButton;

class LoginWidget : public QWidget
{
    Q_OBJECT
public:
    explicit LoginWidget(QWidget *parent = 0);
    virtual ~LoginWidget();
signals:
    void keyCaught(QKeyEvent *e);
protected slots:
    void loginButtonClicked();
    bool event(QEvent *myEvent);
    virtual void  keyPressEvent(QKeyEvent *event);

protected:
    DECLARE_CUSTOM_EVENT()
    void onLogin();
    void onLogoff(int errorCode);

private:
    QLineEdit* editLoginId;
    QLineEdit* editPassword;
    QCheckBox* checkSavePassword;
    QPushButton* buttonLogin;
    bool firstTime;
};

#endif // LOGINWIDGET_H
